﻿@model IEnumerable<Web.Message>

@{
    ViewBag.Title = "Archive";
}

<script type="text/javascript">
    $(function () {
        $("table.tablesorter").tablesorter({ headers: { 0: { sorter: false }, 4: { sorter: false} }, sortList: [[0, 0]] })
        .tablesorterPager({ container: $("#pager") });
    });
</script>

@Html.Partial("_MessageMenuBar")

<h2>Archive</h2>

<table class="tablesorter">
<thead>
    <tr>
        <th>
            Read
        </th>
        <th>
            Title
        </th>
        <th>
            From
        </th>

        <th>
            Time sent
        </th>

        <th>
        
        </th>
    </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.opened)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.title)
        </td>

        <td>
            @Html.DisplayFor(modelItem => item.Usersender.name)
        </td>

        <td>
            @Html.DisplayFor(modelItem => item.timesent)
        </td>

        <td>
            @Html.ActionLink("Read", "Details", new { id=item.id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.id })
        </td>
    </tr>
}
</tbody>
</table>
<div id="pager" class="pager">
	<form>
		<img src="@Url.Content("~/Content/images/first.png")" class="first" />
            <img src="@Url.Content("~/Content/images/prev.png")" class="prev" />
            <input type="text" class="pagedisplay" />
            <img src="@Url.Content("~/Content/images/next.png")" class="next" />
            <img src="@Url.Content("~/Content/images/last.png")" class="last" />
		<select class="pagesize">
			<option selected="selected" value="5">5</option>
			<option value="10">10</option>
			<option value="15">15</option>
			<option  value="20">20</option>
		</select>
	</form>
</div>

